import pickle
import keras
import numpy as np
from keras.models import Sequential, load_model

with open('../training_data/test.pkl', 'rb') as file:
	data = pickle.load(file)

x_test = np.asarray(data['x'], dtype='float32')
y_test = np.asarray(data['y'], dtype='float32')

#x_test = np.asarray(x_train[segment_val:segment_test], dtype='float32')
#y_test = np.asarray(y_train[segment_val:segment_test], dtype='float32')

#test_data = {'x':x_test, 'y':y_test}
#with open('../training_data/test.pkl','wb') as file:
#	pickle.dump(test_data, file)

model = load_model('../log/checkpoint-19-1.67947.hdf5')

for i in range(x_test.shape[0]):
	print(model.predict(np.asarray([x_test[i]])))
	print(y_test[i])
#y_pred = model.predict(x_test[:3])
#y_pred = np.argmax(y_pred, axis=1)
'''
print(y_pred)
print(y_test[0:3])

print(y_test.shape[0])
print(np.sum(np.equal(y_test, np.ones(y_test.shape[0]))))

yes = np.sum(np.equal(y_pred, y_test))

print (float(yes) / y_test.shape[0])
#print(model.predict(x_test))'''
